import request from '../axios'

// 列出某人所有的药店
export function listShopByUserId (userId) {
  const url = '/api/shop/list/user'
  const params = { userId }
  return request.get(url, { params })
}

// 列出某人所有的药店
export function listShop () {
  const url = '/api/shop/list'
  return request.get(url)
}

// 获取药店
export function getShop (id) {
  const url = '/api/shop/id?id=' + id
  return request.get(url)
}

// 获取药店
export function addShop (shop) {
  const url = '/api/shop/add'
  const data = {
    ...shop
  }
  data.json = true
  data.Loading = true
  return request.post(url, data)
}

// 列出某线路的药店
export function listShopByRoute (routeId) {
  const url = '/api/shop/route'
  const params = { routeId }
  return request.get(url, { params })
}
